﻿using ModernShopping.AppCode;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace ModernShopping
{
    public partial class ModernShopping : System.Web.UI.MasterPage
    {
        protected override void OnInit(EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Request.GetLoginInfo() != null && Session.GetLoginInfo() == null)
                {
                    LoginInfo loginInfo = Request.GetLoginInfo();
                    Session.SetLoginInfo(loginInfo);
                }
            }
            base.OnInit(e);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session.GetLoginInfo() != null)
            {
                LoginInfo loginInfo = Session.GetLoginInfo();
                if (loginInfo.IsAdmin())
                {

                }
                else if (loginInfo.IsUser())
                {
                    MultiViewMenu.SetActiveView(ViewUser);
                }
            }
            else
            {
                MultiViewMenu.SetActiveView(ViewGuess);
            }
        }
    }
}